package com.yyx.app1.main.MainActivity_Control.MainButton;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.yyx.app1.R;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by yuexing on 2015/9/15.
 */
@EViewGroup(R.layout.view_main_activity)
public class MainButton extends FrameLayout {

    @ViewById
    ImageView view_main_activity_background,view_main_activity_ico;

    @ViewById
    TextView view_main_activity_title,view_main_activity_subheading;

    public MainButton(Context context) {
        super(context);
    }

    public MainButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MainButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public void bindControl(String title,String subheading,int ico,int background)
    {
        view_main_activity_title.setText(title);
        view_main_activity_subheading.setText(subheading);
        view_main_activity_ico.setImageResource(ico);
        view_main_activity_background.setBackgroundResource(background);
    }

    public ImageView getIcoView()
    {
        return view_main_activity_ico;
    }
}
